.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 6px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.input-wrapper {
  position: relative;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  font-size: 16px;
  transition: all 0.3s ease;
  background: rgba(30, 41, 59, 0.6);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
}

.form-input:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2), 0 4px 20px rgba(0, 0, 0, 0.3);
  background: rgba(30, 41, 59, 0.8);
}

.form-input.error {
  border-color: var(--error-color);
}

.form-input:disabled {
  background-color: rgba(30, 41, 59, 0.4);
  cursor: not-allowed;
  opacity: 0.7;
}

.error-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
}

.error-message {
  font-size: 12px;
  color: var(--error-color);
  margin-top: 4px;
}

.general-error {
  padding: 12px;
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  text-align: center;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  position: relative;
}

.checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: relative;
  height: 18px;
  width: 18px;
  background-color: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.checkbox-label:hover input ~ .checkmark {
  border-color: var(--primary-color);
}

.checkbox-label input:checked ~ .checkmark {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-label input:checked ~ .checkmark:after {
  display: block;
}

.forgot-password {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.2s ease;
}

.forgot-password:hover {
  color: #ffffff;
  text-decoration: underline;
}

.submit-btn {
  width: 100%;
  padding: 16px 20px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #ffffff;
  border: 1px solid rgba(99, 102, 241, 0.5);
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
  backdrop-filter: blur(10px);
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(99, 102, 241, 0.4);
  background: linear-gradient(135deg, #7c3aed, #6366f1);
}

.submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.switch-auth {
  text-align: center;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 20px;
}

.switch-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
  margin-left: 4px;
  font-size: 14px;
  transition: color 0.2s ease;
}

.switch-btn:hover:not(:disabled) {
  color: #ffffff;
  text-decoration: underline;
}

.switch-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.terms-label {
  align-items: flex-start;
  margin-top: 4px;
}

.terms-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-weight: 500;
}

.terms-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.password-strength {
  margin-top: 8px;
}

.strength-bar {
  height: 4px;
  background-color: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.strength-fill {
  height: 100%;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-text {
  font-size: 12px;
  font-weight: 500;
}

/* Login Type Toggle */
.login-type-toggle {
  display: flex;
  margin-bottom: 1.5rem;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 4px;
  position: relative;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.toggle-btn {
  flex: 1;
  padding: 0.75rem;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
}

.toggle-btn.active {
  color: #ffffff;
  font-weight: 600;
}

.toggle-btn:hover:not(.active) {
  color: rgba(255, 255, 255, 0.8);
}

/* Active indicator */
.login-type-toggle::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  height: calc(100% - 8px);
  width: calc(50% - 4px);
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-radius: 6px;
  transition: transform 0.3s ease;
  z-index: 1;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.login-type-toggle.phone-active::before {
  transform: translateX(100%);
}

/* Verification Code Button */
.input-wrapper.with-button {
  display: flex;
  gap: 10px;
}

.verification-code-btn {
  padding: 0 15px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border: 1px solid rgba(99, 102, 241, 0.5);
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
  backdrop-filter: blur(5px);
}

.verification-code-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  background: linear-gradient(135deg, #7c3aed, #6366f1);
}

.verification-code-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Captcha Component */
.captcha-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.captcha-image {
  width: 120px;
  height: 40px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  letter-spacing: 2px;
  color: #333;
  user-select: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.captcha-image::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.3) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.6s;
}

.captcha-image:hover::before {
  transform: translateX(100%);
}

.captcha-refresh {
  padding: 8px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.captcha-refresh:hover {
  background: rgba(30, 41, 59, 0.8);
}

.captcha-input {
  flex: 1;
  max-width: 120px;
}

@media (max-width: 480px) {
  .form-input {
    padding: 12px 14px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .form-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .submit-btn {
    padding: 14px;
  }
  
  .login-type-toggle {
    margin-bottom: 1rem;
  }
  
  .toggle-btn {
    padding: 0.6rem;
    font-size: 0.85rem;
  }
  
  .verification-code-btn {
    padding: 0 10px;
    font-size: 0.8rem;
  }
  
  .captcha-container {
    flex-wrap: wrap;
  }
  
  .captcha-image {
    width: 100px;
    height: 35px;
  }
  
  .captcha-input {
    max-width: 100px;
  }
}